package com.hq.myapplicationdemo.model;

import android.text.TextUtils;



import java.io.Serializable;
import java.util.List;
import java.util.Objects;

public class IndustryBean extends  BaseFilterBean implements Serializable {
    private Integer industryId;

    /**
     * 名称
     */
    private String name;
    private String aliasName;
    private String icon;
    /**
     * 父级名称
     */
    private String parentName;

    /**
     * 上级ID
     */
    private Integer parentId;

    /**
     * 选择状态
     */
    private int selected;

    private List<IndustryBean> childList;

    public String getAliasName() {
        return aliasName;
    }

    public void setAliasName(String aliasName) {
        this.aliasName = aliasName;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

    @Override
    public List<IndustryBean> getChildList() {
        return childList;
    }

    public void setChildList(List<IndustryBean> childList) {
        this.childList = childList;
    }

    public Integer getIndustryId() {
        return industryId;
    }

    public void setIndustryId(Integer industryId) {
        this.industryId = industryId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    public String getShowName(){
        return TextUtils.isEmpty(parentName)?name:parentName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
       IndustryBean that = (IndustryBean) o;
        return Objects.equals(industryId, that.industryId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(industryId);
    }

    @Override
    public String getItemName() {
        return name;
    }

    @Override
    public int getId() {
        return industryId;
    }

    @Override
    public int getSelecteStatus() {
        return selected;
    }

    @Override
    public void setSelecteStatus(int status) {
        selected= status;
    }
}
